/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.pod.hoteishilton.application;

import edu.pod.hoteishilton.database.DatabaseInterface;
import edu.pod.hoteishilton.facade.Facade;
import edu.pod.hoteishilton.facade.IFacade;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

/**
 *
 * @author Tigaz
 */
public class ServerMain {

    public ServerMain() {}

    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws NotBoundException, MalformedURLException, RemoteException {
        DatabaseInterface dtb = (DatabaseInterface) Naming.lookup("//localhost:12345/HoteisHiltonDatabase");

        LocateRegistry.createRegistry(12346);
        IFacade facade = (IFacade)new Facade(dtb);
        Naming.rebind("//localhost:12346/HoteisHiltonServer", facade);
        System.out.println("Escutando Requisicoes...");
    }
}
